Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
The "original" argument must be of type function. Received an instance of Object

I used to have this:

const util = require('util');
const exec = util.promisify(require('child_process').exec);

Then I refactored to this (or at least my attempt to here):

import * as exec from 'child_process';
const execPromise = util.promisify(exec);

Now I am getting the error TypeError: The "original" argument must be of type function. Received an instance of Object on the exec in util.promisify

Not sure how to quite get this working like it was but with this new import syntax for Typescript (specifically related to `@typescript-eslint/no-var-requires

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You're looking for

import { exec } from 'child_process';
const execPromise = util.promisify(exec);

The * as exec did import the whole child_process module into a module namespace object.

about 4 years ago · Santiago Trujillo Denunciar

0

Try this...

import * as childProcess from 'child_process';
const execPromise = util.promisify(childProcess.exec);
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda